<?php
include(dirname(__FILE__).'/../public/public_products.php');
class Ws_jpProducts extends PublicProducts {
	
	var $db, $web_fage;
	function __construct($arr = NULL) {
		$this->db = $GLOBALS ['db'];
		$this->web_fage = 1;
		parent::__construct ( $this->db, $this->web_fage );
	}
	
	/**
	 * 返回feature功能点
	 *
	 * @param array $get
	 *        	字段数组
	 * @return string
	 */
	function get_sidebar($get = array() ) {
		$id = $get['产品ID'];
		$name = trim($get['产品名称']);		
		$row = $this->productInfo( $id );
		$os = $row['product_os'];
		
		if ($os=='Win'){
		$cat_name='Win 製品';
		$sql="SELECT * FROM	category where cat_title='{$cat_name}'";
		$row = $this->db->getOneRs( $sql );
		$cat_id=$row['cat_id'];
		$sql="SELECT * FROM	category where parent_id='{$cat_id}'";
		$cat1=$row = $this->db->getAll( $sql );
		$str='<h3 class="win_tit"><span>'.$cat_name.'</span> </h3>
  <div class="box_main sid_nav">';
		}
		elseif ($os=='Mac')
		{
			$cat_name='Mac 製品';
			$sql="SELECT * FROM	category where cat_title='{$cat_name}'";
			$row = $this->db->getOneRs( $sql );
			$cat_id=$row['cat_id'];
			$sql="SELECT * FROM	category where parent_id='{$cat_id}' AND is_delete=0 order by sort_order";
			$cat1=$row = $this->db->getAll( $sql );
			$str='<h3 class="mac_tit"><span>'.$cat_name.'</span> </h3>
			<div class="box_main sid_nav">';
		}
		foreach ($cat1 as $v)
		{
			$sql="SELECT * FROM	category where parent_id='{$v['cat_id']}' AND is_delete=0 order by sort_order ";
			$cat2=$row = $this->db->getAll( $sql );
			$str2="";
			
			foreach ($cat2 as $v2){
				{
					$sql="select * from won_product where cat_id='{$v2['cat_id']}' AND won_product_delete = 0 ";
					$rst=$this->db->getAll( $sql );
						
							foreach ($rst as $k){
					$url='';
					if ($rst!=''){			
						$sql="SELECT p.* FROM won_product won_p 
				LEFT JOIN product p ON p.product_id = won_p.won_product_id WHERE id = '{$k['id']}' AND won_p.won_product_delete = 0 ";
						$product=$this->db->getOneRs( $sql );
						/* echo "<pre>";
						print_r($product); */
						if($product!=null){
						$v2['cat_title']=$product['product_name'];
						//处理分类显示的产品名
						
						if( substr(strtolower($v2['cat_title'] ), 0, 11) == 'wondershare' )	$v2['cat_title'] = substr( $v2['cat_title'], 11);
						if (substr($v2['cat_title'],-9,8)=='Japanese')
						{
							$length=strlen($v2['cat_title']);
							$v2['cat_title']= substr( $v2['cat_title'], 0,$length-10);
						}
						
						
						
						
						$sql = "SELECT tab.url
						FROM won_product won_p
						LEFT JOIN Table_254 tab ON tab.Field_22345 = won_p.id
						WHERE won_p.id = {$k['id']}";
						$rst = $this->db->getOneRs($sql);
						$url=url_replace($get['url'], $rst['url'], 'wondershare.jp');}
						//$url= DOC_URL.$rst['url'];}
				$str2=$str2.'<dd>- <a href="'.$url.'">'.$v2['cat_title'].'</a></dd>';		
					} 
					}
					
					
					
				}
			}			
			$str=$str.'<dl>
      <dt>'.$v['cat_title'].'</dt>
      '.$str2.'
    </dl>' ;

		}
		
		$str=$str.' </div>
  <div class="box_bottom"></div>
</div>';
			return $str;

	}
	function sysIcon($get)
	{
		if( $this->productOs($get)=='Win')return 'icon_win3.png';
		elseif( $this->productOs($get)=='Mac')return 'icon_mac3.png';
	}
	//去品牌去站点加系统
	function productNameNoBrand( $get ){
		$id = $get['产品ID'];
		$name = trim($get['产品名称']);
		if( substr(strtolower( $name ), 0, 11) == 'wondershare' )	$name = substr( $name, 11);
		if (substr($name,-9,8)=='Japanese')  
		{
			$length=strlen($name);
			$name = substr( $name, 0,$length-10);
		}
		//加系统
		$row = $this->productInfo( $id );
		/* echo "<pre>";
		 print_r($row);exit(); */
		$os = $row['product_os'];
		if( $os == 'Win' ){
			if( !strpos( $name, ' for Windows') ) $name .= '（Win版）';
			else $name=str_replace('for Windows', '（Win版）', $name);
		}
		if( $os == 'Mac' ){
			if( !strpos( $name, 'for Mac') ) $name .= '（Mac版）';
			else 						
				$name=str_replace('for Mac', '（Mac版）', $name);}
		return $name;
	}
	
	
	function get_original_price($get)
	{
	$price=$this->productPriceOldAndCurr($get);
	$row['original_price']=$price['old'];

	return isset($row['original_price'])?substr($row['original_price'],1):0;
	}
	function get_guide($get)
	{
		$str = '';
		$id = ( int ) $get ['产品ID'];
		$row = $this->productInfo( $id );
		return isset($row['product_guide_content'])?$row['product_guide_content']:0;
	}
	function get_discount_price($get)
	{
		$price=$this->productPriceOldAndCurr($get);
	$row['discount_price']=$price['curr'];
		return isset($row['discount_price'])?substr($row['discount_price'],1):0;
	}
function productNameHadOs($get){
	$id = $get['产品ID'];
	$name = trim($get['产品名称']);
	
	$row = $this->productInfo( $id );
	/* echo "<pre>";
	print_r($row);exit(); */
	$os = $row['product_os'];
	if( $os == 'Win' ){
		if( !strpos( $name, 'for Windows') ) $name .= '（Win版）';
	}
	if( $os == 'Mac' ){
		if( !strpos( $name, 'for Windows') ) $name .= '（Mac版）';
	}
	return $name; 
}

function get_comment($get)
{
	
}
function productOs($get){
	$id = $get['产品ID'];
	$name = trim($get['产品名称']);
	$row = $this->productInfo( $id );
	$os = $row['product_os'];
	return $os;
}	
function get_product_place($get)
{
	$id = $get['产品ID'];
	$name = trim($get['产品名称']);
	$row = $this->productInfo( $id );
	$os=$this['product_os'];
	$str='<a href="http://www.wondershare.jp/index.html">Wondershare</a>
　>　
<a href="http://www.wondershare.jp/product-win.html">メディア変換ソフト</a>
　>　
<a href="http://www.wondershare.jp/win/video-converter-pro.html">メディア変換Windows版</a>
　>　
<a href="#">ファイル変換</a>';
}
function  pay_and_use($get){
	$id = $get['产品ID'];
	$name = trim($get['产品名称']);
	$row = $this->productInfo( $id );
	$sql="SELECT tab.url
	FROM won_product won_p
	LEFT JOIN Table_264 tab ON tab.Field_22422 = won_p.id
	WHERE won_p.id = {$id} ";
	//$pay_url=DOC_URL.$this->db->getOne ( $sql );
	$pay_url=url_replace($get['url'], $this->db->getOne ( $sql ), 'wondershare.jp');
	$download_url=$this->productDownLoadUrl($get);
	
	if ($name=='Wondershare PowerSuite Golden (Japanese)' ||  $name=='Wondershare WinSuite (Japanese)' || $name=='Wondershare LiveBoot (Japanese)')
	{
		$str=$row['product_isfree']==1?'<div class="pro_btn">
<a href="'.$download_url.'">
<img title="ダウンロード" alt="ダウンロード" src="../images/mac-fantashow2/bottomdown.gif">
</a>
</div>':
		'<div class="pro_btn">
<a href="'.$download_url.'">
<img title="ダウンロード" alt="ダウンロード" src="http://www.wondershare.jp/images/mac-fantashow2/bottomdown.gif">
</a>
</div>
<div class="pro_btn">
<a class="buy2" href="'.$pay_url.'">今すぐ購入</a>
</div>';
		
		return $str;
	}
	
	if($name=='iPhone・iPad・iPodデータ復元    (Japanese)')
	{
		return ' <div class="pro_btn"> <a href="../shop/win-iphone-data-recovery.html" class="buy2">今すぐ購入</a> 
        	<div class="downArea fl"><a class="down2">無料体験</a>
            	<div><span class="dot"></span><p>対象デバイスを選択</p>
               	  <ul class="fl">
                    	<li><a href="http://download.wondershare.jp/drfone-iphone4_full1186.exe">• iPhone 4</a></li>
                        <li><a href="http://download.wondershare.jp/drfone-iphone3gs_full1187.exe">• iPhone 3GS</a></li>
                  </ul>
                  <ul class="fl">
                    	<li><a href="http://download.wondershare.jp/drfone-ipad_full1188.exe">• iPad 1</a></li>
                        <li><a href="http://download.wondershare.jp/drfone-ipod_full1189.exe">• iPod Touch 4</a></li>
                    </ul>
                </div>
            </div>
        </div>';
	}
	
	$str=$row['product_isfree']==1?'<div class="pro_btn"> 
	<a href="'.$download_url.'" class="down2 ">無料体験</a></div>':
	'<div class="pro_btn"> <a href="'.$pay_url.'" class="buy2">今すぐ購入</a> <a href="'.$download_url.'" class="down2 ">無料体験</a>  </div>';
	return $str;
}

/**
 * 返回关联热门产品
 *
 * @param array $get
 *        	字段数组
 * @return string
 */
function relProduct($get) {
	$str = '';
	$id = ( int ) $get ['产品ID'];
	$recommended_product = $this->db->getOne( "SELECT recommended_product FROM won_product WHERE id = {$id}" );
	if ($recommended_product!='')
	{	
		$recommended_product=explode(',', $recommended_product);
		foreach ($recommended_product as $v)
		{
			$product=$this->productInfo($v);
			$img=$product['product_box_middle'];
			$sql = "SELECT tab.*
			FROM won_product won_p
			LEFT JOIN Table_254 tab ON tab.Field_22345 = won_p.id
			WHERE won_p.id = {$v} ";
			$product_index = $this->db->getOneRs( $sql );
			//  		print_r($product_index);exit();
// 			$url=DOC_URL.$product_index['url'];
			$url=url_replace($get['url'], $product_index['url'], 'wondershare.jp');
			$icon=$product_index['Field_22353'];
			// 	print_r($product);exit();
			$str=$str.'<div class="pro_index">
			<div class="product_img"><a  href="'.$url.'"><img src="'.$img.'" alt="'.$this->productNameNoBrand(array('产品id'=>$v,'产品名称'=>$product['product_name'])).'" border="0" title="'.$this->productNameNoBrand(array('产品id'=>$v,'产品名称'=>$product['product_name'])).'"　width="110"/></a><span></span>
			'.$icon.'
			</div>
			<h3 class="product_name"> <a href="'.$url.' ">'.$this->productNameNoBrand(array('产品id'=>$v,'产品名称'=>$product['product_name'])).'</a></h3>
			<p class="product_info">'.$product['product_intro'].'</p>
			<p class="product_info">'.$product['product_content'].'</p>
			'.$this->pay_and_use3(array('产品ID'=>$v,'产品名称'=>'')).'
			</div>';
		}
		return '
	<div class="recommended mt12">
        <h2>人気製品</h2>
       '.$str.$this->relProductName(array('产品id'=>$v,'产品名称'=>$product['product_name'])).'
      </div>
		
	';
	}
	else 
	{
		if ($this->productOs($get)=='Win')$str='
		<div class="recommended mt12">
        <h2>人気製品</h2>
        <div class="pro_index">
          <div class="product_img"><a  href="http://www.wondershare.jp/win/video-editor.html "><img src="http://www.wondershare.jp/images/video-editor/videoeditor-box.png" alt="動画編集 プロ" border="0" title="Wondershare 動画編集 プロ"　width="110"/></a><span></span>
            <div class="pro_icon"><img src="http://www.wondershare.jp/images/pro_icon/icon_win3.png" border="0" title="win" /><img src="http://www.wondershare.jp/images/video-editor/002.png" border="0" title="DVD編集" /><img src="http://www.wondershare.jp/images/video-editor/004.png" border="0" title="DVD編集" /></div>
          </div>
          <h3 class="product_name"> <a href="http://www.wondershare.jp/win/video-editor.html ">動画編集 プロ</a></h3>
          <p class="product_info">動画と画像をより美しく編集可能、楽しいエフェクトがいっぱい！</p>
          <p class="product_info">動画編集なら、　「動画編集プロ」にお任せ！AVI、MP4、WMV、MKV、3GP、FLV、MOVなどの汎用動画形式に対応。
            いろんな用途に活躍する編集ソフトで、オリジナル作品をYouTubeやFacebookに数クリックでアップロード、シェアします！</p>
         <div class="pro_btn"><a href="http://www.wondershare.jp/new-purchase/win_photomovie_studio6_wedding.html" class="buy3">&gt;&gt;購入</a> <a href="http://download.wondershare.jp/pms6w_full1051.exe" class="trial3">&gt;&gt;試用する</a></div>
        </div>
        <div class="pro_index">
          <div class="product_img"><a  href="http://www.wondershare.jp/win/photomovie_studio_wedding.html"><img src="http://www.wondershare.jp/images/pms6-wedding/pms6_w_box110.png" alt="PhotoMovie Studio 6 Pro（Win版）" border="0" title="Wondershare PhotoMovie Studio 6 Pro（Win版）"/></a>
            <div class="pro_icon"><img src="http://www.wondershare.jp/images/pro_icon/icon_win3.png" border="0" title="win" /><img src="http://www.wondershare.jp/images/pro_icon/icon-photo-moive05.png" border="0" title="フォトムービー" /><img src="http://www.wondershare.jp/images/pro_icon/icon_badge01.png" border="0" title="音楽・映像 編集" /></div>
          </div>
          <h3 class="product_name"> <a href="http://www.wondershare.jp/win/photomovie_studio_wedding.html">PhotoMovie Studio 6 Wedding（Win版）</a></h3>
          <p class="product_info">フォトムービー作成の定番ソフトに、結婚式専用テンプレートが満載！</p>
          <p class="product_info"> 豊富な結婚式専用テンプレート及びその他のテーマ別スタイル・3Dテンプレート・コンテンツを搭載。デジカメ写真に加えて、ビデオ素材も利用可能。高品質な結婚式フォト・ムービーが作れます。</p>
          <div class="pro_btn"><a href="http://www.wondershare.jp/new-purchase/win_photomovie_studio6_wedding.html" class="buy3">&gt;&gt;購入</a> <a href="http://download.wondershare.jp/pms6w_full1051.exe" class="trial3">&gt;&gt;試用する</a></div>
          <div class="versiob_btn"><a href="http://www.wondershare.jp/mac/fantashow.html">Mac版はこちら &gt;&gt;</a></div>
        </div>
      </div>
		';
		elseif ($this->productOs($get)=='Mac')$str='
		
		<div class="recommended mt12">
        <h2>人気製品</h2>
        <div class="pro_index">
          <div class="product_img"><a  href="http://www.wondershare.jp/win/video-editor.html "><img src="http://www.wondershare.jp/images/video-editor/videoeditor-box.png" alt="動画編集 プロ" border="0" title="Wondershare 動画編集 プロ"　width="110"/></a><span></span>
            <div class="pro_icon"><img src="http://www.wondershare.jp/images/pro_icon/icon_win3.png" border="0" title="win" /><img src="http://www.wondershare.jp/images/video-editor/002.png" border="0" title="DVD編集" /><img src="http://www.wondershare.jp/images/video-editor/004.png" border="0" title="DVD編集" /></div>
          </div>
          <h3 class="product_name"> <a href="http://www.wondershare.jp/win/video-editor.html ">動画編集 プロ</a></h3>
          <p class="product_info">動画と画像をより美しく編集可能、楽しいエフェクトがいっぱい！</p>
          <p class="product_info">動画編集なら、　「動画編集プロ」にお任せ！AVI、MP4、WMV、MKV、3GP、FLV、MOVなどの汎用動画形式に対応。
            いろんな用途に活躍する編集ソフトで、オリジナル作品をYouTubeやFacebookに数クリックでアップロード、シェアします！</p>
         <div class="pro_btn"><a href="http://www.wondershare.jp/new-purchase/win_photomovie_studio6_wedding.html" class="buy3">&gt;&gt;購入</a> <a href="http://download.wondershare.jp/pms6w_full1051.exe" class="trial3">&gt;&gt;試用する</a></div>
        </div>
        <div class="pro_index">
          <div class="product_img"><a  href="http://www.wondershare.jp/win/photomovie_studio_wedding.html"><img src="http://www.wondershare.jp/images/pms6-wedding/pms6_w_box110.png" alt="PhotoMovie Studio 6 Pro（Win版）" border="0" title="Wondershare PhotoMovie Studio 6 Pro（Win版）"/></a>
            <div class="pro_icon"><img src="http://www.wondershare.jp/images/pro_icon/icon_win3.png" border="0" title="win" /><img src="http://www.wondershare.jp/images/pro_icon/icon-photo-moive05.png" border="0" title="フォトムービー" /><img src="http://www.wondershare.jp/images/pro_icon/icon_badge01.png" border="0" title="音楽・映像 編集" /></div>
          </div>
          <h3 class="product_name"> <a href="http://www.wondershare.jp/win/photomovie_studio_wedding.html">PhotoMovie Studio 6 Wedding（Win版）</a></h3>
          <p class="product_info">フォトムービー作成の定番ソフトに、結婚式専用テンプレートが満載！</p>
          <p class="product_info"> 豊富な結婚式専用テンプレート及びその他のテーマ別スタイル・3Dテンプレート・コンテンツを搭載。デジカメ写真に加えて、ビデオ素材も利用可能。高品質な結婚式フォト・ムービーが作れます。</p>
          <div class="pro_btn"><a href="http://www.wondershare.jp/new-purchase/win_photomovie_studio6_wedding.html" class="buy3">&gt;&gt;購入</a> <a href="http://download.wondershare.jp/pms6w_full1051.exe" class="trial3">&gt;&gt;試用する</a></div>
          <div class="versiob_btn"><a href="http://www.wondershare.jp/mac/fantashow.html">Mac版はこちら &gt;&gt;</a></div>
        </div>
      </div>
		';
	}
	return $str;
		}



function  pay_and_use2($get){
	$id = $get['产品ID'];
	$name = trim($get['产品名称']);
	$row = $this->productInfo( $id );
	$sql="SELECT tab.url
	FROM won_product won_p
	LEFT JOIN Table_264 tab ON tab.Field_22422 = won_p.id
	WHERE won_p.id = {$id} ";
// 	$pay_url=DOC_URL.$this->db->getOne ( $sql );
	$pay_url=url_replace($get['url'], $this->db->getOne ( $sql ), 'wondershare.jp');
	$download_url=$this->productDownLoadUrl($get);
	
	if ($name=='Wondershare PowerSuite Golden (Japanese)' ||  $name=='Wondershare WinSuite (Japanese)' || $name=='Wondershare LiveBoot (Japanese)')
	{
		$str=$row['product_isfree']==1?'<div class="btn">
<div class="btdown">
<a href="'.$download_url.'">
<img src="http://www.wondershare.jp/images/mac-fantashow2/bottomdown.gif">
</a>
</div>
</div>':
		'<div class="btn">
<div class="btn01">
<a href="'.$pay_url.'"><img src="http://www.wondershare.jp/images/new/btn01.png"></a> 
</div>
<div class="btdown">
<a href="'.$download_url.'">
<img src="http://www.wondershare.jp/images/mac-fantashow2/bottomdown.gif">
</a>
</div>
</div>';
	
		return $str;
	}
	
	
	
	$str=$row['product_isfree']==1?' <div class="btn">
          <div class="btn02"> <a href="'.$download_url.'"><img src="http://www.wondershare.jp/images/new/btn02.png"></a> </div>
        </div>':
	' <div class="btn">
	      <div class="btn02"> <a href="'.$download_url.'"><img src="http://www.wondershare.jp/images/new/btn02.png"></a></div>
          <div class="btn01"> <a href="'.$pay_url.'"><img src="http://www.wondershare.jp/images/new/btn01.png"></a> 
          </div>
        </div>';
	return $str;
}
function  pay_and_use3($get){
	$id = $get['产品ID'];
	$name = trim($get['产品名称']);
	$row = $this->productInfo( $id );
	$sql="SELECT tab.url
	FROM won_product won_p
	LEFT JOIN Table_264 tab ON tab.Field_22422 = won_p.id
	WHERE won_p.id = {$id} ";
// 	$pay_url=DOC_URL.$this->db->getOne ( $sql );
    $pay_url=url_replace($get['url'], $this->db->getOne ( $sql ), 'wondershare.jp');
	$download_url=$this->productDownLoadUrl($get);
	$str=$row['product_isfree']==1?'<div class="pro_btn">
	<a href="'.$download_url.'" class="trial3">無料体験</a></div>':
	'<div class="pro_btn"> <a href="'.$download_url.'" class="trial3">無料体験</a> <a href="'.$pay_url.'" class="buy3">今すぐ購入</a> </div>';
	return $str;
}
function get_video_demo($get){
	$id = $get['产品ID'];
	$name = trim($get['产品名称']);
	$row = $this->productInfo( $id );
	$productNameHadOs=$this->productNameHadOs($get);
	$str= '<p><a name="sample" id="sample"></a><strong>'.$productNameHadOs.'操作方法1：フィアル変換</strong></p>
          <table>
            <tbody>
              <tr>
                <td><iframe width="'.$row['video_width'].'" height="'.$row['video_higth'].'" src="'.$row['product_video_promo'].'" frameborder="0" allowfullscreen></iframe></td>
              </tr>
            </tbody>
          </table>
          
          
          <p>&nbsp;</p>'.'<table>
            <tbody>
              <tr> </tr>
            </tbody>
          </table>
          <div class="clear"></div>
        </div>';
	return $str;
}
function switchPage($get){
	
// 	print_r($get);exit();
	$id = $get['产品ID'];
	$sql = "SELECT won_attributes_id
	FROM won_product
	WHERE id = {$id} AND won_product_delete = 0 ";
	$att_str = $this->db->getOne ( $sql );
	$att_str = empty ( $att_str ) ? 0 : $att_str;
	//存储所有页面的html标签字符串
	$str_switch='';
	//取切换导航
	if ($att_str!=0){
	$att_array=explode(',', $att_str);
	$length=count($att_array);
	//switch_pages存储所有的切换页面
	$switch_pages=array();
	foreach ($att_array as $v)
	{
		$sql="select * from product_attributes where id={$v}";
		$rst=$this->db->getOneRs($sql);
		$att_name=$rst['name'];
		$sql="select * from Table_268 where Field_22424={$id} and Field_22425='{$att_name}' ";
		$page=$this->db->getOneRs($sql);
		//查询到的根据模版生成的页面
		$page_index=$page['Field_22426'];
		$switch_pages[$page_index]=$page;
	}
	if ($length>=1){
	for ($i=1;$i<=$length;$i++)
	{
		if (isset($get['Field_22425']) && $switch_pages[$i]['Field_22425']==$get['Field_22425'])
		$str_switch.='<li><a href="'.url_replace($get['url'], $switch_pages[$i]['url'], 'wondershare.jp').'" class="current">'.$switch_pages[$i]['Field_22425'].'</a></li>';
		else
		$str_switch.='<li><a href="'.url_replace($get['url'],$switch_pages[$i]['url'], 'wondershare.jp').'">'.$switch_pages[$i]['Field_22425'].'</a></li>';
	}
	}

	}
	$str_feature=$str_guide=$str_environment=$str_comparison=$str_faq=$str_video="";
	
if ($this->get_url_feature($get)!='')
	$str_feature='<li><a href=" '.$this->get_url_feature($get).' "'.($get['TID']==254?'class="current"':'').'>特徴</a></li>';
if ($this->guideUrl($get)!='')
	$str_guide='<li><a href="'.$this->guideUrl($get).'"'.($get['TID']==255?'class="current"':'').'>ガイド</a></li>';
if ($this->get_url_environment($get)!='')
	$str_environment='<li><a href="'.$this->get_url_environment($get).'"'.($get['TID']==257?'class="current"':'').'>動作環境</a></li>';
if ($this->get_url_comparison($get)!='')
	$str_comparison='<li><a href="'.$this->get_url_comparison($get).'"'.($get['TID']==260?'class="current"':'').'>製品比較</a></li>';
if ($this->get_url_faq($get)!='')
	$str_faq='<li><a href="'.$this->get_url_faq($get).'"'.($get['TID']==258?'class="current"':'').'>FAQ</a></li>';
if ($this->get_url_video($get)!='')
	$str_video='<li><a href="'.$this->get_url_video($get).'"'.($get['TID']==259?'class="current"':'').'>デモ動画</a></li>';
	return  '<ul class="tab_list_n">
      '.$str_feature.$str_guide.$str_environment.$str_comparison.$str_faq.$str_video.$str_switch.'
    </ul>';
}


function get_switch_page($get)
{
	$id = $get['产品ID'];
	$article_name=$get['Field_22425'];
	$sql="select * from product_attributes where name='{$article_name}'";
	$rst=$this->db->getOneRs($sql);
	$article_id=$rst['id'];
	$sql="select * from product_page where product_id={$id} and article_id={$article_id}";
	$rst=$this->db->getOneRs($sql);
	return $rst['page_content'];
}

function next_two_page($get){
	
	
}

function get_side_feature($get){
	
	$id = $get['产品ID'];
	$sql="select * from Table_316 where Field_22599='{$id}'";
	$rst=$this->db->getOneRs($sql);
	return $rst['Field_22600'];
}
function get_side_ad($get){
	
	$ad_name=$this->productOs($get);
	$sql="select * from Table_315 where Field_22598='{$ad_name}'";
	$ad=$this->db->getOneRs($sql);
	$ad_product_id=$ad['Field_22596'];
	$sql = "SELECT tab.url
	FROM won_product won_p
	LEFT JOIN Table_254 tab ON tab.Field_22345 = won_p.id
	WHERE won_p.id = {$ad_product_id} ";
	$ad_product_url=url_replace($get['url'], $this->db->getOne ( $sql ), 'wondershare.jp');
	$ad_product_img=$ad['Field_22597'];
	return '<div class="box_sidebar">
<a href="'.$ad_product_url.'">
<img border="0" src="'.$ad_product_img.'">
</a>
</div>';
}



//取得对应产品URL
function relProductUrl($get){
	$id = $get['产品ID'];
	$name = trim($get['产品名称']);
	$row = $this->productInfo( $id );
	$rel_id=$row['product_rel'];
	$rel_row=$this->productInfo( $rel_id );
	$rel_name=$rel_row['product_name'];
	$rel_os=$rel_row['product_os'];
	

	$sql = "SELECT tab.url
	FROM won_product won_p
	LEFT JOIN Table_254 tab ON tab.Field_22345 = won_p.id
	WHERE won_p.won_product_id = {$rel_id} and won_product_delete=0";
	$url = $this->db->getOne ( $sql );
	if (empty ( $url )) {
	
		/* 	$sql = "SELECT tab.url
		FROM won_product won_p
		LEFT JOIN Table_45 tab ON tab.Field_20350 = won_p.id
		WHERE won_p.id = {$id} ";
		$url = $this->db->getOne ( $sql );
		}
	
		$url = str_replace ( 'index.html', '', str_replace ( '/wondershare.com/httpdocs/', 'http://www.wondershare.com/', $url ) ); */
	
		}
		return url_replace($get['url'], $url, 'wondershare.jp');
		
}
//取得对应产品地址
function relProductName($get){

	$id = $get['产品ID'];
	$name = trim($get['产品名称']);
	$row = $this->productInfo( $id );
	$rel_id=$row['product_rel'];
	$rel_row=$this->productInfo( $rel_id );
	$rel_name=$rel_row['product_name'];
	$rel_os=$rel_row['product_os'];
	if($rel_os == 'Win' ){		
		return '<div class="versiob_btn"><img src="../style/style_img/icon_win.png" border="0" /> <a href="'.$this->relProductUrl($get).'">Win製品へ &gt;&gt;</a></div>';
	}
	if($rel_os == 'Mac' ){
		
		return '<div class="versiob_btn"><img src="../style/style_img/icon_mac.png" border="0" /> <a href="'.$this->relProductUrl($get).'">Mac製品へ &gt;&gt;</a></div>';
	}
	
}

function get_url_feature($get)
{
	$url = '';
	$id = ( int ) $get ['产品ID'];
	$sql = "SELECT tab.url
	FROM won_product won_p
	LEFT JOIN Table_254 tab ON tab.Field_22345 = won_p.id
	WHERE won_p.id = {$id} ";
	$url = $this->db->getOne ( $sql );
	if (empty ( $url )) {
		
/* 	$sql = "SELECT tab.url
		FROM won_product won_p
		LEFT JOIN Table_45 tab ON tab.Field_20350 = won_p.id
		WHERE won_p.id = {$id} ";
		$url = $this->db->getOne ( $sql );
		}
	
		$url = str_replace ( 'index.html', '', str_replace ( '/wondershare.com/httpdocs/', 'http://www.wondershare.com/', $url ) ); */
	return '';
}
	return url_replace($get['url'], $url, 'wondershare.jp');
}


function guideUrl($get)
{
	$url = '';
	$id = ( int ) $get ['产品ID'];
	$sql = "SELECT tab.url
	FROM won_product won_p
	LEFT JOIN Table_255 tab ON tab.Field_22358 = won_p.id
	WHERE won_p.id = {$id} ";
	$url = $this->db->getOne ( $sql );
	if (empty ( $url )) {

		/* 	$sql = "SELECT tab.url
		 FROM won_product won_p
		LEFT JOIN Table_45 tab ON tab.Field_20350 = won_p.id
		WHERE won_p.id = {$id} ";
		$url = $this->db->getOne ( $sql );
		}

		$url = str_replace ( 'index.html', '', str_replace ( '/wondershare.com/httpdocs/', 'http://www.wondershare.com/', $url ) ); */
		return '';
	}
	return url_replace($get['url'], $url, 'wondershare.jp');
}
function get_url_environment($get)
{
	$url = '';
	$id = ( int ) $get ['产品ID'];

	$sql = "SELECT tab.url
	FROM won_product won_p
	LEFT JOIN Table_257 tab ON tab.Field_22370 = won_p.id
	WHERE won_p.id = {$id} ";
	$url = $this->db->getOne ( $sql );
	if (empty ( $url )) {

		/* 	$sql = "SELECT tab.url
		 FROM won_product won_p
		LEFT JOIN Table_45 tab ON tab.Field_20350 = won_p.id
		WHERE won_p.id = {$id} ";
		$url = $this->db->getOne ( $sql );
		}

		$url = str_replace ( 'index.html', '', str_replace ( '/wondershare.com/httpdocs/', 'http://www.wondershare.com/', $url ) ); */
		return '';
	}
	return url_replace($get['url'], $url, 'wondershare.jp');
}
function get_url_comparison($get)
{
	$url = '';
	$id = ( int ) $get ['产品ID'];

	$sql = "SELECT tab.url
	FROM won_product won_p
	LEFT JOIN Table_260 tab ON tab.Field_22388 = won_p.id
	WHERE won_p.id = {$id} ";
	$url = $this->db->getOne ( $sql );
	if (empty ( $url )) {

		/* 	$sql = "SELECT tab.url
		 FROM won_product won_p
		LEFT JOIN Table_45 tab ON tab.Field_20350 = won_p.id
		WHERE won_p.id = {$id} ";
		$url = $this->db->getOne ( $sql );
		}

		$url = str_replace ( 'index.html', '', str_replace ( '/wondershare.com/httpdocs/', 'http://www.wondershare.com/', $url ) ); */
		return '';
	}
	return url_replace($get['url'], $url, 'wondershare.jp');
}
function get_url_faq($get)
{
	$url = '';
	$id = ( int ) $get ['产品ID'];

	$sql = "SELECT tab.url
	FROM won_product won_p
	LEFT JOIN Table_258 tab ON tab.Field_22376 = won_p.id
	WHERE won_p.id = {$id} ";
	$url = $this->db->getOne ( $sql );
	if (empty ( $url )) {

		/* 	$sql = "SELECT tab.url
		 FROM won_product won_p
		LEFT JOIN Table_45 tab ON tab.Field_20350 = won_p.id
		WHERE won_p.id = {$id} ";
		$url = $this->db->getOne ( $sql );
		}

		$url = str_replace ( 'index.html', '', str_replace ( '/wondershare.com/httpdocs/', 'http://www.wondershare.com/', $url ) ); */
		return '';
	}
	return url_replace($get['url'], $url, 'wondershare.jp');
}
function get_url_video($get)
{
	$url = '';
	$id = ( int ) $get ['产品ID'];

	$sql = "SELECT tab.url
	FROM won_product won_p
	LEFT JOIN Table_259 tab ON tab.Field_22382 = won_p.id
	WHERE won_p.id = {$id} ";
	$url = $this->db->getOne ( $sql );
	if (empty ( $url )) {

		/* 	$sql = "SELECT tab.url
		 FROM won_product won_p
		LEFT JOIN Table_45 tab ON tab.Field_20350 = won_p.id
		WHERE won_p.id = {$id} ";
		$url = $this->db->getOne ( $sql );
		}

		$url = str_replace ( 'index.html', '', str_replace ( '/wondershare.com/httpdocs/', 'http://www.wondershare.com/', $url ) ); */
		return '';
	}
	return url_replace($get['url'], $url, 'wondershare.jp');
}
}